package sagroup.dracots;

import sagroup.dracots.TupleType;
import lime2.Location;
import lime2.TupleID;

/**
 * This Class records cost information of an operation
 * 
 * @author Huang Xiaodong
 * @author Liang Qian
 */
public class CostInfo {
	TupleType type;
	byte operationType;
	Location sourceLocation;
	Location targetLocation;
	int size;
	long totalReadTime;
	long totalWriteTime;
	long logTime;
	long startTime;
	long processTime;
	long endTime;
	TupleID tupleID;

	public CostInfo(TupleType type, byte operationType,
			Location sourceLocation, Location targetLocation, int size,
			long totalReadTime, long totalWriteTime, long startTime,
			long processTime, long endTime, TupleID tupleID) {
		this.type = type;
		this.operationType = operationType;
		this.sourceLocation = sourceLocation;
		this.targetLocation = targetLocation;
		this.size = size;
		this.totalReadTime = totalReadTime;
		this.totalWriteTime = totalWriteTime;
		this.logTime = 0;// Here initial it with 0, modify it later when keeping
		// log
		this.startTime = startTime;
		this.processTime = processTime;
		this.endTime = endTime;
		this.tupleID = tupleID;
	}

	public CostInfo() {
		// TODO Auto-generated constructor stub
	}

	public void setLogTime(long logTime) {
		this.logTime = logTime;
	}

	public long getLogTime() {
		return logTime;
	}

	public TupleType getType() {
		return type;
	}

	public byte getOperationType() {
		return operationType;
	}

	public Location getSourceLocation() {
		return sourceLocation;
	}

	public Location getTargetLocation() {
		return targetLocation;
	}

	public int getSize() {
		return size;
	}

	public long getTotalReadTime() {
		return totalReadTime;
	}

	public double getTotalWriteTime() {
		return totalWriteTime;
	}

	public long getStartTime() {
		return startTime;
	}

	public long getProcessTime() {
		return processTime;
	}

	public long getEndTime() {
		return endTime;
	}

	public TupleID getTupleID() {
		return tupleID;
	}
}